<template>
  <div class="pc-nodes inner-box">
    <bread backTitle="节点"></bread>
    <div class="title">
      <h1>全球BTY节点情况</h1>
      <p>地图显示了世界各个国家及地区可到达BTY节点的集中度</p>
    </div>
    <div class="container table-shadow flex-center">
      <div class="left">
        <div class="head flex-left">
          <i class="iconfont iconjiedianxuanze"></i>
          <span>共 {{total}} 个节点</span>
        </div>
        <nodes-map :nodes="nodes" :range="range" :needRange="false"></nodes-map>
        <!-- <nodes-count></nodes-count> -->
      </div>
      <!-- 节点占比 -->
      <div class="right">
        <div class="head">{{nowTime}}</div>
        <div class="scroll-box">
          <div class="node-item" v-for="(item,index) in nodes" :key="index">
            <p>{{index+1}} {{item.name}}</p>
            <div class="flex-left">
              <el-progress
                :percentage="Number((item.value*100/total).toFixed(2))"
                class="node-progress"
                :show-text="false"
              ></el-progress>
              <span class="percent-txt">{{item.value}} （{{(item.value*100/total).toFixed(2)}}%）</span>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import Bread from "@/components/computer/Breadcrumb.vue";
import nodesMap from "./Map.vue";
import nodesCount from "./NodesCount";
import NodesBase from "@/mixins/Nodes/nodesBase.js";
export default {
  mixins: [NodesBase],
  components: {
    Bread,
    nodesMap,
    nodesCount
  }
};
</script>

<style lang="scss" scoped>
.pc-nodes {
  .title {
    margin-top: 20px;
    h1 {
      font-size: 16px;
      font-family: PingFangSC-Semibold;
      font-weight: 500;
      color: $black_title;
    }
    p {
      margin: 10px 0 20px;
      font-size: 14px;
      font-family: PingFangSC-Regular;
      font-weight: 400;
      color: $font_grey;
    }
  }
  .container {
    border-radius: 2px;
    border: 1px solid rgba(235, 239, 241, 1);
    background: $white;
    .left {
      width: calc(100% - 400px);
      height: 814px;
      .head {
        height: 45px;
        padding-left: 15px;
        .iconjiedianxuanze {
          color: $blue;
          font-size: 22px;
          margin-right: 10px;
        }
        span {
          font-size: 22px;
          font-family: PingFangSC-Semibold;
          font-weight: 500;
          color: $orange_deep;
        }
      }
    }
    .right {
      width: 400px;
      height: 814px;
      border-left: 1px solid #ebeff1;
      .head {
        height: 60px;
        line-height: 60px;
        text-align: center;
        color: $black;
        font-size: 14px;
        border-bottom: 1px solid #ebeff1;
      }
      .scroll-box {
        height: calc(100% - 60px);
        padding: 20px 30px;
        overflow-y: scroll;
        .node-item {
          height: 50px;
          margin-top: 20px;
          p {
            margin-bottom: 10px;
            font-size: 14px;
            color: $black;
            font-family: PingFangSC-Medium;
            font-weight: 500;
          }
          .node-progress {
            width: 205px;
          }
          .percent-txt {
            margin-left: 30px;
            color: $black_title;
          }
        }
        .node-item:first-child {
          margin-top: 0;
        }
      }
      .scroll-box::-webkit-scrollbar {
        width: 5px;
        height: 5px;
        background: #e0e3e6;
      }
      .scroll-box::-webkit-scrollbar-thumb {
        border-radius: 50px;
        background: $blue;
      }
    }
  }
}
</style>

<style lang="scss">
.pc-nodes {
  .el-progress-bar__inner {
    background: $blue;
  }
}
</style>